package com.jsmile.cloud.accountcenter.api.feign;

import javax.validation.Valid;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.jsmile.cloud.accountcenter.api.constants.AccountConstants;
import com.jsmile.cloud.accountcenter.api.req.shop.ReqTenantCreate;
import com.jsmile.cloud.accountcenter.api.req.shop.ReqTenantDelete;
import com.jsmile.cloud.accountcenter.api.req.shop.ReqTenantQuery;
import com.jsmile.cloud.accountcenter.api.req.shop.ReqTenantUpdate;
import com.jsmile.cloud.accountcenter.api.res.ResTenant;
import com.jsmile.mall.api.JSmileResult;
import com.jsmile.mall.api.to.JsmilePage;

@FeignClient(value = AccountConstants.APPLICATION_NAME, contextId = "tenant")
public interface TenantServiceApi {

    // TODO 获取租户信息
    @RequestMapping(value = "/feign/tenant/getTenant", method = RequestMethod.POST)
    JSmileResult<ResTenant> getTenant(@RequestBody @Valid ReqTenantDelete reqTenantDelete);

    // TODO 添加租户信息
    @RequestMapping(value = "/feign/tenant/addTenant", method = RequestMethod.POST)
    JSmileResult<ResTenant> addTenant(@RequestBody @Valid ReqTenantCreate reqTenantSave);

    // TODO 更新租户信息
    @RequestMapping(value = "/feign/tenant/updateTenant", method = RequestMethod.POST)
    JSmileResult<ResTenant> updateTenant(@RequestBody @Valid ReqTenantUpdate reqTenantUpdate);

    // TODO 获取租户列表
    @RequestMapping(value = "/feign/tenant/getTenantPageList", method = RequestMethod.POST)
    JSmileResult<JsmilePage<ResTenant>> getTenantPageList(@RequestBody @Valid ReqTenantQuery reqTenantQuery);
}
